<template>
  <div class="all">
    <div v-for="(item, index) in list" :key="index">
      <h3 @click="getdatail(item.actId)">#{{ item.title }}</h3>
      <p>{{ item.text[0] }}</p>
      <p>{{ item.text[1] }}</p>
      <img :src="item.sharePicUrl" alt="" />
      <van-divider
        :style="{ color: '#1989fa', borderColor: '#1989fa', padding: '0 16px' }"
      >
      </van-divider>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      list: [],
    };
  },
  computed: {},
  watch: {},

  methods: {
    getalldt() {
      axios.get("http://localhost:3000/hot/topic").then((res) => {
        // console.log(res);
        this.list = res.data.hot;
        console.log(this.list);
        // let text = res.data.event[0].json;
        // let text1 = JSON.parse(text);
        // console.log(text1);
      });
    },
    getdatail(actid) {
      console.log(actid);
      this.$router.push(`/datail/${actid}`);
    },
  },
  created() {
    this.getalldt();
  },
  mounted() {},
  components: {},
};
</script>
<style scoped>
.all {
  padding: 0 50px;
}

img {
  width: 100%;
}
p {
  font-size: 12px;
  text-indent: 20px;
}
h3 {
  color: #4994df;
}
</style>
